package com.momo.mapper.mapper;

import com.momo.mapper.dataobject.DeptDO;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * 由于需要对分页支持,请直接使用对应的DAO类
 * 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成
 * The Table SYS_DEPT.
 * 部门表
 */
public interface DeptDOMapper{

    /**
     * desc:插入表:SYS_DEPT.<br/>
     * descSql =  SELECT LAST_INSERT_ID() INSERT INTO SYS_DEPT( GROUP_ID ,SYS_DEPT_PARENT_ID ,DEL_FLAG ,CREATE_BY ,UPDATE_BY ,SYS_IS_LEAF ,SYS_DEPT_NAME ,SYS_DEPT_UUID ,SYS_DEPT_LEVEL ,SYS_DEPT_REMARK ,SYS_DEPT_SEQ ,CREATE_TIME ,UPDATE_TIME )VALUES( #{groupId,jdbcType=BIGINT} ,#{sysDeptParentId,jdbcType=BIGINT} ,#{delFlag,jdbcType=CHAR} ,#{createBy,jdbcType=VARCHAR} ,#{updateBy,jdbcType=VARCHAR} ,#{sysIsLeaf,jdbcType=CHAR} ,#{sysDeptName,jdbcType=VARCHAR} ,#{sysDeptUuid,jdbcType=VARCHAR} ,#{sysDeptLevel,jdbcType=VARCHAR} ,#{sysDeptRemark,jdbcType=VARCHAR} ,#{sysDeptSeq,jdbcType=INTEGER} ,#{createTime,jdbcType=TIMESTAMP} ,#{updateTime,jdbcType=TIMESTAMP} )
     * @param entity entity
     * @return int
     */
    int insert(DeptDO entity);
    /**
     * desc:更新表:SYS_DEPT.<br/>
     * descSql =  UPDATE SYS_DEPT SET GROUP_ID = #{groupId,jdbcType=BIGINT} ,SYS_DEPT_PARENT_ID = #{sysDeptParentId,jdbcType=BIGINT} ,DEL_FLAG = #{delFlag,jdbcType=CHAR} ,CREATE_BY = #{createBy,jdbcType=VARCHAR} ,UPDATE_BY = #{updateBy,jdbcType=VARCHAR} ,SYS_IS_LEAF = #{sysIsLeaf,jdbcType=CHAR} ,SYS_DEPT_NAME = #{sysDeptName,jdbcType=VARCHAR} ,SYS_DEPT_UUID = #{sysDeptUuid,jdbcType=VARCHAR} ,SYS_DEPT_LEVEL = #{sysDeptLevel,jdbcType=VARCHAR} ,SYS_DEPT_REMARK = #{sysDeptRemark,jdbcType=VARCHAR} ,SYS_DEPT_SEQ = #{sysDeptSeq,jdbcType=INTEGER} ,CREATE_TIME = #{createTime,jdbcType=TIMESTAMP} ,UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP} WHERE ID = #{id,jdbcType=BIGINT}
     * @param entity entity
     * @return int
     */
    int update(DeptDO entity);
    /**
     * desc:根据主键删除数据:SYS_DEPT.<br/>
     * descSql =  DELETE FROM SYS_DEPT WHERE ID = #{id,jdbcType=BIGINT}
     * @param id id
     * @return int
     */
    int deleteById(Long id);
    /**
     * desc:根据主键获取数据:SYS_DEPT.<br/>
     * descSql =  SELECT * FROM SYS_DEPT WHERE ID = #{id,jdbcType=BIGINT}
     * @param id id
     * @return DeptDO
     */
    DeptDO getById(Long id);
    /**
     * desc:getAllDept.<br/>
     * descSql =  select id, sys_dept_uuid, sys_dept_name, sys_dept_parent_id, sys_dept_level, sys_dept_seq, sys_is_leaf, sys_dept_remark, group_id,create_time,sys_dept_status from sys_dept AND group_id = #{groupId,jdbcType=BIGINT} 
     * @param groupId groupId
     * @return List<DeptDO>
     */
    List<DeptDO> getAllDept(Long groupId);
    /**
     * desc:getDeptByUUID.<br/>
     * descSql =  select id, sys_dept_uuid, sys_dept_name, sys_dept_parent_id, sys_dept_level, sys_dept_seq, sys_is_leaf, sys_dept_remark, group_id,create_time,sys_dept_status from sys_dept where sys_dept_uuid=#{sys_dept_uuid,jdbcType=VARCHAR}
     * @param sys_dept_uuid sys_dept_uuid
     * @return DeptDO
     */
    DeptDO getDeptByUUID(String sys_dept_uuid);
    /**
     * desc:updateByPrimaryKeySelective.<br/>
     * descSql =  update sys_dept sys_dept_uuid = #{sysDeptUuid,jdbcType=VARCHAR}, sys_dept_name = #{sysDeptName,jdbcType=VARCHAR}, sys_dept_parent_id = #{sysDeptParentId,jdbcType=BIGINT}, sys_dept_level = #{sysDeptLevel,jdbcType=VARCHAR}, sys_dept_seq = #{sysDeptSeq,jdbcType=INTEGER}, sys_is_leaf = #{sysIsLeaf,jdbcType=CHAR}, sys_dept_status = #{sysDeptStatus,jdbcType=CHAR}, sys_dept_remark = #{sysDeptRemark,jdbcType=VARCHAR}, group_id = #{groupId,jdbcType=BIGINT}, del_flag = #{delFlag,jdbcType=CHAR}, create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, update_by = #{updateBy,jdbcType=VARCHAR}, where id = #{id,jdbcType=BIGINT}
     * @param entity entity
     * @return int
     */
    int updateByPrimaryKeySelective(DeptDO entity);
    /**
     * desc:insertSelective.<br/>
     * descSql =  insert into sys_dept id, sys_dept_uuid, sys_dept_name, sys_dept_parent_id, sys_dept_level, sys_dept_seq, sys_is_leaf, sys_dept_status, sys_dept_remark, group_id, del_flag, create_by, create_time, update_time, update_by, #{id,jdbcType=BIGINT}, #{sysDeptUuid,jdbcType=VARCHAR}, #{sysDeptName,jdbcType=VARCHAR}, #{sysDeptParentId,jdbcType=BIGINT}, #{sysDeptLevel,jdbcType=VARCHAR}, #{sysDeptSeq,jdbcType=INTEGER}, #{sysIsLeaf,jdbcType=CHAR}, #{sysDeptStatus,jdbcType=CHAR}, #{sysDeptRemark,jdbcType=VARCHAR}, #{groupId,jdbcType=BIGINT}, #{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
     * @param entity entity
     * @return int
     */
    int insertSelective(DeptDO entity);
}
